package com.sky.activity.service.impl;

import java.util.List;
import com.sky.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sky.activity.mapper.TbVolunteerActivityMapper;
import com.sky.activity.domain.TbVolunteerActivity;
import com.sky.activity.service.ITbVolunteerActivityService;

/**
 * 志愿者活动管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-07
 */
@Service
public class TbVolunteerActivityServiceImpl implements ITbVolunteerActivityService 
{
    @Autowired
    private TbVolunteerActivityMapper tbVolunteerActivityMapper;

    /**
     * 查询志愿者活动管理
     * 
     * @param id 志愿者活动管理主键
     * @return 志愿者活动管理
     */
    @Override
    public TbVolunteerActivity selectTbVolunteerActivityById(Long id)
    {
        return tbVolunteerActivityMapper.selectTbVolunteerActivityById(id);
    }

    /**
     * 查询志愿者活动管理列表
     * 
     * @param tbVolunteerActivity 志愿者活动管理
     * @return 志愿者活动管理
     */
    @Override
    public List<TbVolunteerActivity> selectTbVolunteerActivityList(TbVolunteerActivity tbVolunteerActivity)
    {
        return tbVolunteerActivityMapper.selectTbVolunteerActivityList(tbVolunteerActivity);
    }

    /**
     * 新增志愿者活动管理
     * 
     * @param tbVolunteerActivity 志愿者活动管理
     * @return 结果
     */
    @Override
    public int insertTbVolunteerActivity(TbVolunteerActivity tbVolunteerActivity)
    {
        tbVolunteerActivity.setCreateTime(DateUtils.getNowDate());
        return tbVolunteerActivityMapper.insertTbVolunteerActivity(tbVolunteerActivity);
    }

    /**
     * 修改志愿者活动管理
     * 
     * @param tbVolunteerActivity 志愿者活动管理
     * @return 结果
     */
    @Override
    public int updateTbVolunteerActivity(TbVolunteerActivity tbVolunteerActivity)
    {
        tbVolunteerActivity.setUpdateTime(DateUtils.getNowDate());
        return tbVolunteerActivityMapper.updateTbVolunteerActivity(tbVolunteerActivity);
    }

    /**
     * 批量删除志愿者活动管理
     * 
     * @param ids 需要删除的志愿者活动管理主键
     * @return 结果
     */
    @Override
    public int deleteTbVolunteerActivityByIds(Long[] ids)
    {
        return tbVolunteerActivityMapper.deleteTbVolunteerActivityByIds(ids);
    }

    /**
     * 删除志愿者活动管理信息
     * 
     * @param id 志愿者活动管理主键
     * @return 结果
     */
    @Override
    public int deleteTbVolunteerActivityById(Long id)
    {
        return tbVolunteerActivityMapper.deleteTbVolunteerActivityById(id);
    }
}
